﻿@{
    //ViewBag.Title = "Index";//页面上重新重义了title
}
@model PagedList<MvcMasterPage.Entity.User>
<img src="../../Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png" />
<p>@Html.TextBox("keyword")
    <input type="button" id="search" value="查询" /></p>
<div id="list">
    @Html.Partial("List", Model)
</div>
<script src="https://raw.github.com/jaubourg/jquery-jsonp/master/src/jquery.jsonp.js"></script>
<script>
    $(function () {
        $("#search").click(function () {
            $.ajax({
                Url: '@Url.Action("Index", "Home")',
                data: { name: "a", page: 1 },
                type: "Get",
                success: function (data) {
                    $("#list").html(data);
                }
            });
        });
    });
    //跨域调用公用的ＡＰＩ，需要使用jsonp，但使用jsonp后error属性将失灵，需要使用jquery-jsonp这个插件才可以在jsonp后启用error
    function jsonpFun() {
        $.jsonp({
            url: 'http://www.jsonp.com/Common/GetUserAPI?userID=1',
            callbackParameter: 'callback',
            success: function (data) {
                alert(data.name);
            },
            error: function (xOptions, textStatus) {
                alert("获取用户信息失败");
            }
        });
    }
</script>
@Html.Action("LogOn", "Home")
<h1>
    当前菜单ID：@ViewBag.MenuID</h1>
<input type="hidden" id="UserImg" name="UserImg" value="" />
<iframe src='@Url.Action("Upload", "WebCommon", new
                                                {
                                                    ParentImgInput = "UserImg",
                                                    ParentImgSrc = "headpic",
                                                    IsCompletePath = "1",
                                                })' scrolling="no" id='Iframe1' style="width: 400px;
                    height: 22px" frameborder="0"></iframe>
<img id="headpic" />
@Html.RoleHtmlTags(1, false, "bobo",
@<fieldset id="bobo">
    <legend>登陆后显示</legend><span>登陆后session["userid"]存在了，才会显示这块</span>
    <div>
        <input type="button" value="上传" />
        <input type="button" value="发作品" />
        <input type="text">
        <button>
            提交</button>
    </div>
</fieldset>)
<a href="1" onclick="jsonpFun();return false;">跨域不能用,需要用jsonp幼</a> <a href="1" onclick="Boxy_Extensions.alertDelayFun('close',1000);return false;">
    boxyalert</a> 